<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
</head>
<body>
欢迎 <span id="username"></span> 使用系统
</body>
<script>

    // document.getElementById('username').innerText=  sessionStorage.getItem("username");
    // document.getElementById('username').innerText=  localStorage.getItem("username");

    var user = JSON.parse(localStorage.getItem("user"));
    document.getElementById('username').innerText = user.username;

</script>
</html>